{extend name="layout/layout" /}


{block name="style"}
<link rel="stylesheet" href="__RES__/css/page.css">
{/block}

{block name="content"}
<div class="am-cf am-padding am-padding-bottom-0">
    <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">角色管理</strong> / <small>角色关联用户</small></div>
</div>

<hr>

<div class="am-g">
    <div class="am-u-sm-12">

<form action="__URL__/roleuserDo" method="post">
            <legend>角色：{$roleInfo.name}</legend>
            <input type="hidden" name="role_id" value="{$roleInfo.id}">
    <a  href="{:url('/admin/role/rolelist')}" class="am-btn am-btn-primary am-btn-xs"><<返回角色列表</a>

    <button  type="submit" class="am-btn am-btn-primary am-btn-xs">#保存关联#</button>

        <table class="am-table am-table-striped am-table-hover table-main">
            <thead>
            <tr>
                <th class="table-id">-</th>
                <th class="table-id">ID</th>
                <th class="table-title">用户名</th>
                <th class="table-type">备注</th>
                <th class="table-author am-hide-sm-only">-</th>
                <th class="table-date am-hide-sm-only">更新时间</th>
            </tr>
            </thead>
            <tbody>
            {volist name='datas' id='item'}
            <tr>

                <td>
                    {if condition='in_array($item["id"], $hasUser)'}
                    <input type="checkbox" checked name="user_id[]" value="{$item.id}">
                    {else/}
                    <input type="checkbox" name="user_id[]" value="{$item.id}">
                    {/if}
                </td>
                <td> {$item.id}</td>
                <td>{$item.username}</td>
                <td>{$item.remark}</td>

                <td>-</td>
                <td>{$item.update_time}</td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <div class="am-cf">

            <div class="am-fr digg">
                {$datas->render()|raw}
            </div>
        </div>


    </div>
</div>
{/block}